
aa = {'list':22,'apa':33}
print(aa)
print(aa['list'])
print(aa['apa'])

list1={'retcode': 0,
 'retlist': [{'desc': 'java课程', 'display_idx': 1, 'id': 1266, 'name': 'java'},
             {'desc': '物理', 'display_idx': 1, 'id': 1277, 'name': '物理'},
             {'desc': '初中英语', 'display_idx': 1, 'id': 1283, 'name': '英语'}]
 }


list2={'retcode': 0,
 'retlist': [{'desc': 'java课程', 'display_idx': 1, 'id': 1266, 'name': 'java'},
             {'desc': '物理', 'display_idx': 1, 'id': 1277, 'name': '物理'},
             {'desc': '初中英语', 'display_idx': 1, 'id': 1283, 'name': '英语'},
             {'desc': '中国', 'display_idx': 1, 'id': 1284, 'name': '中国'}]
 }
#
newcourse=[]
for course in list2['retlist']:
    if course not in list1['retlist']:
        # newcourse=course
        newcourse.append(course)
        break
print(newcourse)


# #列表生成式找在list1里面没有的元素
new=[one for one in list2['retlist'] if one not in list1['retlist']]
print(new)

